<template>
  <div class="nav">
    <span class="back" @click="goBack" v-show="back">&lt;&nbsp;返回</span>
    <p>{{title}}</p>
  </div>
</template>

<script>
export default {
  props:['back','title'],
  data() {
    return {

    };
  },
  methods: {
    goBack(){
      this.$router.go(-1)
    }
  },
};
</script>

<style scoped>
  .nav{
    width: 100vw;
    line-height: .6rem;
    text-align: center;
    background: orangered;
    color:white;
    position:relative;
    top:0;
    left: 0;
    font-size: .3rem;
  }
  .back{
    position: absolute;
    left: .2rem;
  }
</style>
